#include <iostream>
using namespace std;

int gcd(int x, int y)
{
	if(y>x) return gcd(y, x);
	if(!y) return x;
	return gcd(y, x%y);
}

int main()
{
	int x, y, z;
	cin>>x>>y>>z;
	
	cout<<gcd(x, gcd(y, z));
	return 0;
 } 
